Optimal. Leaf size=407 \[ \frac {(i a+b)^3 (A-i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f}-\frac {(i a-b)^3 (A+i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{\sqrt {c+i d} f}+\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.11, antiderivative size = 407, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 7, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {3728, 3718,
3711, 3620, 3618, 65, 214} \begin {gather*} \frac {2 \sqrt {c+d \tan (e+f x)} \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (15 d^2 (A-C)-10 B c d+8 c^2 C\right )-\left (b^3 \left (70 c d^2 (A-C)-56 B c^2 d+105 B d^3+48 c^3 C\right )\right )\right )}{105 d^4 f}+\frac {2 b \tan (e+f x) \sqrt {c+d \tan (e+f x)} \left (35 b d^2 (a B+A b-b C)+4 (b c-a d) (-6 a C d-7 b B d+6 b c C)\right )}{105 d^3 f}-\frac {(-b+i a)^3 (A+i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{f \sqrt {c+i d}}+\frac {(b+i a)^3 (A-i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f \sqrt {c-i d}}-\frac {2 (-6 a C d-7 b B d+6 b c C) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3618
Rule 3620
Rule 3711
Rule 3718
Rule 3728
Rubi steps
\begin {align*} \int \frac {(a+b \tan (e+f x))^3 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{\sqrt {c+d \tan (e+f x)}} \, dx &=\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}+\frac {2 \int \frac {(a+b \tan (e+f x))^2 \left (\frac {1}{2} (-6 b c C+a (7 A-C) d)+\frac {7}{2} (A b+a B-b C) d \tan (e+f x)-\frac {1}{2} (6 b c C-7 b B d-6 a C d) \tan ^2(e+f x)\right )}{\sqrt {c+d \tan (e+f x)}} \, dx}{7 d}\\ &=-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}+\frac {4 \int \frac {(a+b \tan (e+f x)) \left (\frac {1}{4} (-5 a d (6 b c C-a (7 A-C) d)+(4 b c+a d) (6 b c C-7 b B d-6 a C d))+\frac {35}{4} \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^2 \tan (e+f x)+\frac {1}{4} \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan ^2(e+f x)\right )}{\sqrt {c+d \tan (e+f x)}} \, dx}{35 d^2}\\ &=\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}-\frac {8 \int \frac {\frac {1}{8} \left (-3 a^3 (35 A-11 C) d^3-42 a b^2 c d (4 c C-5 B d)+3 a^2 b d^2 (64 c C+7 B d)+2 b^3 c \left (24 c^2 C-28 B c d+35 (A-C) d^2\right )\right )-\frac {105}{8} \left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) d^3 \tan (e+f x)-\frac {1}{8} \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \tan ^2(e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{105 d^3}\\ &=\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}-\frac {8 \int \frac {\frac {105}{8} \left (3 a^2 b B-b^3 B-a^3 (A-C)+3 a b^2 (A-C)\right ) d^3-\frac {105}{8} \left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) d^3 \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{105 d^3}\\ &=\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}+\frac {1}{2} \left ((a-i b)^3 (A-i B-C)\right ) \int \frac {1+i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx+\frac {1}{2} \left ((a+i b)^3 (A+i B-C)\right ) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx\\ &=\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}-\frac {\left (i (a+i b)^3 (A+i B-C)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{2 f}+\frac {\left ((a-i b)^3 (i A+B-i C)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c-i d x}} \, dx,x,i \tan (e+f x)\right )}{2 f}\\ &=\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}-\frac {\left ((a-i b)^3 (A-i B-C)\right ) \text {Subst}\left (\int \frac {1}{-1-\frac {i c}{d}+\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{d f}-\frac {\left ((a+i b)^3 (A+i B-C)\right ) \text {Subst}\left (\int \frac {1}{-1+\frac {i c}{d}-\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{d f}\\ &=-\frac {(a-i b)^3 (i A+B-i C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f}-\frac {(i a-b)^3 (A+i B-C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{\sqrt {c+i d} f}+\frac {2 \left (72 a^3 C d^3-6 a^2 b d^2 (32 c C-49 B d)+21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )-b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{105 d^4 f}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{105 d^3 f}-\frac {2 (6 b c C-7 b B d-6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{35 d^2 f}+\frac {2 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{7 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 5.77, size = 392, normalized size = 0.96 \begin {gather*} \frac {-\frac {105 (a-i b)^3 (i A+B-i C) d \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d}}+\frac {105 i (a+i b)^3 (A+i B-C) d \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{\sqrt {c+i d}}-\frac {2 \left (-72 a^3 C d^3+6 a^2 b d^2 (32 c C-49 B d)-21 a b^2 d \left (8 c^2 C-10 B c d+15 (A-C) d^2\right )+b^3 \left (48 c^3 C-56 B c^2 d+70 c (A-C) d^2+105 B d^3\right )\right ) \sqrt {c+d \tan (e+f x)}}{d^3}+\frac {2 b \left (35 b (A b+a B-b C) d^2+4 (b c-a d) (6 b c C-7 b B d-6 a C d)\right ) \tan (e+f x) \sqrt {c+d \tan (e+f x)}}{d^2}+\frac {6 (-6 b c C+7 b B d+6 a C d) (a+b \tan (e+f x))^2 \sqrt {c+d \tan (e+f x)}}{d}+30 C (a+b \tan (e+f x))^3 \sqrt {c+d \tan (e+f x)}}{105 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(8227\) vs.
\(2(371)=742\).
time = 0.46, size = 8228, normalized size = 20.22
method | result | size |
derivativedivides | \(\text {Expression too large to display}\) | \(8228\) |
default | \(\text {Expression too large to display}\) | \(8228\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \tan {\left (e + f x \right )}\right )^{3} \left (A + B \tan {\left (e + f x \right )} + C \tan ^{2}{\left (e + f x \right )}\right )}{\sqrt {c + d \tan {\left (e + f x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 122.08, size = 2500, normalized size = 6.14 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________